package com.davies.learn.jbv.domain.dto;



import com.davies.learn.autoconfigure.QueryPage;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;



/**
 * @author davies
 * @date 2023/7/16 10:53
 */
@Data
public class QueryPageDTO<T> implements QueryPage<T> {


    @Max(1000)
    @NotNull
    private Integer size;

    @Max(100)
    @Min(1)
    @NotNull
    private Integer current;


    private T query;


    public Integer getCurrent() {
        return current - 1;
    }

    public Integer getSourceCurrent() {
        return current;
    }
}
